package com.example.myproject.dto.comment;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@Data
@ApiModel("评论列表响应DTO")
public class CommentsListResponse {

    @ApiModelProperty("评论总数")
    private Integer total;

    @ApiModelProperty("评论列表")
    private List<CommentItem> comments;

    @Data
    public static class CommentItem {
        @ApiModelProperty("评论ID")
        private Integer comment_id;

        @ApiModelProperty("评论用户信息")
        private UserInfo user_info;

        @ApiModelProperty("评论内容")
        private String content;

        @ApiModelProperty("格式化后的评论内容")
        private String formatted_content;

        @ApiModelProperty("点赞数")
        private Integer likes_count;

        @ApiModelProperty("当前用户是否已点赞")
        private Boolean user_liked = false;

        @ApiModelProperty("评论时间")
        private String comment_createtime;

        @ApiModelProperty("回复列表")
        private List<CommentItem> replies;
    }

    @Data
    public static class UserInfo {
        @ApiModelProperty("用户ID")
        private Integer user_id;

        @ApiModelProperty("用户名")
        private String username;

        @ApiModelProperty("用户头像URL")
        private String avatar_url;

        @ApiModelProperty("用户等级")
        private Integer level;
    }

    // getter and setter methods
    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public List<CommentItem> getComments() {
        return comments;
    }

    public void setComments(List<CommentItem> comments) {
        this.comments = comments;
    }
}